package com.cskaoyan.market.controller.admin;

import com.cskaoyan.market.annotation.RequiresPermissionsDesc;
import com.cskaoyan.market.db.domain.MarketLog;
import com.cskaoyan.market.service.AdminLogService;
import com.cskaoyan.market.util.ResponseUtil;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServlet;
import java.io.IOException;
import java.util.List;

@RestController
@RequestMapping("/admin/log")
public class AdminLogController extends HttpServlet {

    @Autowired
    private AdminLogService logService ;

    @GetMapping("list")
    @RequiresPermissions("admin:log:list")
    @RequiresPermissionsDesc(menu = {"系统管理", "操作日志"},button = "查询")
    public Object getLogList(Integer page,Integer limit ,String sort,String order) {
        List<MarketLog> logList = logService.list(page,limit,sort,order);
        return ResponseUtil.okList(logList);
    }

}